<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->

    <link rel="stylesheet" href="__STATIC__/bootstrap-4.0.0/dist/css/bootstrap.min.css">

    <link href="__TMPL__/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
    <link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        form .input-order {
            margin-bottom: 0px;
            padding: 0 2px;
            width: 42px;
            font-size: 12px;
        }

        form .input-order:focus {
            outline: none;
        }

        .table-actions {
            margin-top: 5px;
            margin-bottom: 5px;
            padding: 0px;
        }

        .table-list {
            margin-bottom: 0px;
        }

        .form-required {
            color: red;
        }
        .fff{
            background: #ffeeba;
        }
    </style>
    <script type="text/javascript">
        //全局变量
        var GV = {
            ROOT: "__ROOT__/",
            WEB_ROOT: "__WEB_ROOT__/",
            JS_ROOT: "static/js/",
            APP: '{$Request.module}'/*当前应用名*/
        };
    </script>
    <script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
    <script src="__STATIC__/js/wind.js"></script>
    <script src="__TMPL__/public/assets/js/bootstrap.min.js"></script>
    <script>
        Wind.css('artDialog');
        Wind.css('layer');
        $(function () {
            $("[data-toggle='tooltip']").tooltip({
                container:'body',
                html:true,
            });
            $("li.dropdown").hover(function () {
                $(this).addClass("open");
            }, function () {
                $(this).removeClass("open");
            });
        });
    </script>
    <if condition="APP_DEBUG">
        <style>
            #think_page_trace_open {
                z-index: 9999;
            }
        </style>
    </if>

</head>
<body>
<div style="height: 20px;">

</div>
<div style="margin-left: 20px">
    <button type="button" id="yans" class="btn btn-success">刷新</button>
    <button type="button" class="btn btn-warning"><a href="{:url('AdminGambit/index')}">返回</a></button>
</div>
<div style="height: 20px;"></div>

    <div class="media" style="margin-left: 20px;">
        <img class="mr-3" src="__STATIC__/bootstrap-4.0.0/dist/image/love.jpg" width="60" alt="Generic placeholder image">
        <div class="media-body">
            <h5 class="mt-0"><strong>{$commentResult['post_title']}</strong></h5>
            {$commentResult['post_content']}
            <div ><span class="fff">点赞（{$commentResult['getlickcount']}）</span>，<span class="fff">评论（{$commentResult['counts']}）</span>，<span class="fff">收藏({$commentResult['getfavoritecount']})</span>，
                <a href="{:url('AdminGambit/deletetheme',array('id'=>$commentResult['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>
                ，<a href="{:url('AdminGambit/shieldtheme',array('id'=>$commentResult['id']))}" class="js-ajax-shield">
                    <if condition="($commentResult.post_status == 1)">
                        已审核
                        <else/>
                        待审核
                    </if>

                </a>
            <div style="margin-top: 30px;"></div>
            <!--<button type="button" class="btn btn-secondary">评论列表</button>-->
            <button type="button" class="btn btn-light" style="font-weight: bold">评论列表:</button>
            <div style="border-top:1px solid #efefef;"></div>
            <notempty name="commentResult.getcomments">
                <foreach name="commentResult.getcomments" item="vo">
                    <if condition="($vo.parent_id == 0)">
                    <div class="media mt-3" >
                        <a class="pr-3" href="#">
                            <img src="__STATIC__/bootstrap-4.0.0/dist/image/love.jpg" width="60" alt="Generic placeholder image">
                        </a>
                        <div class="media-body" >
                            {$vo.content}
                            <div style="background: red;">
                                <div style="background:#efefef;margin: 20px 0 20px 0;float:left;margin-top: 35px;">
                                    <foreach name="commentsondata" item="voo">
                                        <if condition="($vo.id == $voo.parent_id) && ($voo.parent_id != 0) && ($voo.delete_time == 0)">
                                            <div class="media mt-3" >
                                                <div class="media-body">
                                                    <div style="float: left;font-weight: bold">胡歌:</div>
                                                    <div style="float: left">&nbsp;&nbsp;&nbsp;&nbsp;{$voo.content}</div>
                                                    <div style="float: left;margin-left: 20px;">
                                                        <a href="{:url('AdminGambit/commentdelete',array('id'=>$voo['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>，
                                                        <a href="{:url('AdminGambit/commentshield',array('id'=>$voo['id']))}" class="js-ajax-shield">

                                                            <if condition="($voo.status == 1)">
                                                                取消屏蔽
                                                                <else/>
                                                                屏蔽
                                                            </if>

                                                        </a>
                                                    </div>
                                                </div>
                                            </div>

                                        </if>
                                    </foreach>
                                </div>
                            </div>
                            <div style="clear: both;">
                                <span class="fff">点赞（{$vo.getlickcount}）</span>
                                ，<span class="fff">评论（{$vo.counts}）</span>，
                                <a href="{:url('AdminGambit/commentdelete',array('id'=>$vo['id']))}" class="js-ajax-delete">
                                    {:lang('DELETE')}
                                </a>，
                                <a href="{:url('AdminGambit/commentshield',array('id'=>$vo['id']))}" class="js-ajax-shield">
                                    <if condition="($vo.status == 1)">
                                        取消屏蔽
                                        <else/>
                                        屏蔽
                                    </if>


                                </a>，
                            </div>
                        </div>
                    </div>
                    </if>
                    <div style="border-top:1px solid #efefef;"></div>
                </foreach>
            <else/>
            <div class="media mt-3" >
                <div class="media-body" >
                    暂无任何评论……
                </div>
            </div>
            </notempty>
        </div>
    </div>

<script src="__STATIC__/js/jquery/jquery-3.3.1.min.js"></script>
<script>
    $("#yans").click(function(){
        location.reload();
    });


</script>
<script src="__STATIC__/js/admin.js"></script>
<script>

    function reloadPage(win) {
        win.location.reload();
    }

    $(function () {
        setCookie("refersh_time", 0);
        Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
            //批量复制
            $('.js-articles-copy').click(function (e) {
                var ids = [];
                $("input[name='ids[]']").each(function () {
                    if ($(this).is(':checked')) {
                        ids.push($(this).val());
                    }
                });

                if (ids.length == 0) {
                    art.dialog.through({
                        id: 'error',
                        icon: 'error',
                        content: '您没有勾选信息，无法进行操作！',
                        cancelVal: '关闭',
                        cancel: true
                    });
                    return false;
                }

                ids = ids.join(',');
                art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=copy&ids=" + ids, {
                    title: "批量复制",
                    width: "300px"
                });
            });
            //批量移动
            $('.js-articles-move').click(function (e) {
                var ids = [];
                $("input[name='ids[]']").each(function () {
                    if ($(this).is(':checked')) {
                        ids.push($(this).val());
                    }
                });

                if (ids.length == 0) {
                    art.dialog.through({
                        id: 'error',
                        icon: 'error',
                        content: '您没有勾选信息，无法进行操作！',
                        cancelVal: '关闭',
                        cancel: true
                    });
                    return false;
                }

                ids = ids.join(',');
                art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=move&old_term_id={$term.term_id|default=0}&ids=" + ids, {
                    title: "批量移动",
                    width: "300px"
                });
            });
        });
    });


    //屏蔽评论
    //所有的删除操作，删除数据后刷新页面
    if ($('a.js-ajax-shield').length) {
        Wind.css('artDialog');
        Wind.use('artDialog', 'noty', function () {
            $('.js-ajax-shield').on('click', function (e) {
                e.preventDefault();
                var $_this  = this,
                    $this   = $($_this),
                    href    = $this.data('href'),
                    refresh = $this.data('refresh'),
                    msg     = $this.data('msg');
                href        = href ? href : $this.attr('href');

                art.dialog({
                    title: false,
                    icon: 'question',
                    content: msg ? msg : '确定要屏蔽吗？',
                    follow: $_this,
                    close: function () {
                        $_this.focus(); //关闭时让触发弹窗的元素获取焦点
                        return true;
                    },
                    okVal: "确定",
                    ok: function () {
                        $.getJSON(href).done(function (data) {
                            if (data.code == '1') {
                                noty({
                                    text: data.msg,
                                    type: 'success',
                                    layout: 'topCenter',
                                    modal: true,
                                    // animation: {
                                    //     open: 'animated bounceInDown', // Animate.css class names
                                    //     close: 'animated bounceOutUp', // Animate.css class names
                                    // },
                                    timeout: 800,
                                    callback: {
                                        afterClose: function () {
                                            if (refresh == undefined || refresh) {
                                                if (data.url) {
                                                    //返回带跳转地址
                                                    window.location.href = data.url;
                                                } else {
                                                    //刷新当前页
                                                    reloadPage(window);
                                                }
                                            }
                                        }
                                    }
                                }).show();

                            } else if (data.code == '0') {
                                //art.dialog.alert(data.info);
                                //alert(data.info);//暂时处理方案
                                art.dialog({
                                    content: data.msg,
                                    icon: 'warning',
                                    ok: function () {
                                        this.title(data.msg);
                                        return true;
                                    }
                                });
                            }
                        });
                    },
                    cancelVal: '关闭',
                    cancel: true
                });
            });

        });
    }
</script>
</body>
</html>